Skip to content

Add RAG module into AgentScope#800

Merged
DavdGao merged 21 commits into
agentscope-ai:mainfrom
DavdGao:dev/rag
Sep 27, 2025
Merged

Add RAG module into AgentScope#800
DavdGao merged 21 commits into
agentscope-ai:mainfrom
DavdGao:dev/rag

Conversation

@DavdGao

@DavdGao DavdGao commented Sep 22, 2025

Copy link
Copy Markdown
Member

AgentScope Version

1.0.4

Description

  • Basic functionalities
    • Finish the RAG module abstraction
    • Provide basic implementations
      • A Qdrant based store class QdrantStore
      • A simple knowledge class SimpleKnowledge
      • A text reader class TextReader and a basic PDF reader class PDFReader
    • Support DashScope multimodal embedding API by DashScopeMultiModalEmbedding
    • Support batch embedding with batch size larger than 10 in DashScopeTextEmbedding
  • Examples
    • Add a RAG example to demonstrate 1) basic usage, 2) agentic RAG, 3) integration with ReActAgent, and 4) multimodal RAG
  • Docs
    • Add RAG section in the tutorial (both Chinese and English)
  • Unittests
    • Add unittests for the store class
    • Add unittests for the knowledge class
    • Add unittests for the reader classes
    • Add unittests for the DashScope multimodal embedding class DashScopeMultiModalEmbedding

Checklist

Please check the following items before code is ready to be reviewed.

  • Code has been formatted with pre-commit run --all-files command
  • All tests are passing
  • Docstrings are in Google style
  • Related documentation has been updated (e.g. links, examples, etc.)
  • Code is ready for review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a comprehensive Retrieval-Augmented Generation (RAG) module to AgentScope that supports both multimodal data and traditional text-based RAG functionality. The module provides document readers, vector database stores, knowledge bases, and integrates with embedding models to enable document-based question answering capabilities.

Key changes:

  • New RAG module with document readers (TextReader, PDFReader) for data chunking
  • Vector database store abstractions with Qdrant implementation for document storage
  • Knowledge base system supporting multimodal embeddings
  • Integration of RAG capabilities into ReActAgent through knowledge parameter

Reviewed Changes

Copilot reviewed 24 out of 25 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/agentscope/rag/ Core RAG module with document, reader, store, and knowledge base implementations
src/agentscope/embedding/ Updated embedding models to support dimensions and multimodal data
src/agentscope/agent/_react_agent.py Added knowledge parameter to ReActAgent for RAG integration
tests/tracer_test.py Updated test to reflect embedding model constructor changes
examples/functionality/rag/ Example usage scripts demonstrating basic and agentic RAG workflows

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/agentscope/rag/_reader/__init__.py Outdated
Comment thread src/agentscope/rag/_simple_knowledge.py
Comment thread src/agentscope/rag/__init__.py Outdated
Comment thread src/agentscope/rag/_store/_qdrant_store.py Outdated
Comment thread src/agentscope/rag/_reader/_pdf_reader.py Outdated
Comment thread src/agentscope/rag/_store/_qdrant_store.py
Comment thread src/agentscope/rag/_reader/_pdf_reader.py
Comment thread src/agentscope/embedding/_dashscope_embedding.py Outdated
Comment thread src/agentscope/agent/_react_agent.py
Comment thread examples/functionality/rag/agentic_usage.py Outdated
Comment thread src/agentscope/rag/_reader/_text_reader.py
Comment thread src/agentscope/rag/_store/_qdrant_store.py Outdated
@DavdGao DavdGao requested a review from Copilot September 27, 2025 04:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 46 out of 47 changed files in this pull request and generated 10 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/agentscope/rag/_reader/__init__.py Outdated
Comment thread tests/rag_reader_test.py
Comment thread tests/rag_knowledge_test.py
Comment thread src/agentscope/rag/_store/_qdrant_store.py Outdated
Comment thread src/agentscope/rag/_reader/_image_reader.py
Comment thread src/agentscope/rag/_simple_knowledge.py
Comment thread src/agentscope/rag/_simple_knowledge.py
Comment thread src/agentscope/rag/__init__.py Outdated
Comment thread src/agentscope/embedding/_openai_embedding.py Outdated
Comment thread src/agentscope/embedding/_ollama_embedding.py Outdated
@DavdGao DavdGao requested a review from Copilot September 27, 2025 08:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 47 out of 48 changed files in this pull request and generated 5 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/agentscope/rag/_reader/_image_reader.py
Comment thread src/agentscope/rag/_reader/_image_reader.py
Comment thread tests/rag_store_test.py Outdated
Comment thread src/agentscope/rag/_reader/_pdf_reader.py
Comment thread src/agentscope/agent/_react_agent.py Outdated
@DavdGao DavdGao requested a review from Copilot September 27, 2025 12:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 46 out of 47 changed files in this pull request and generated 6 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/agentscope/rag/_reader/_image_reader.py
Comment thread src/agentscope/rag/_simple_knowledge.py
Comment thread src/agentscope/rag/_store/_qdrant_store.py Outdated
Comment thread src/agentscope/embedding/_dashscope_multimodal_embedding.py
Comment thread src/agentscope/agent/_react_agent.py Outdated
Comment thread src/agentscope/embedding/_dashscope_embedding.py
@DavdGao DavdGao merged commit d933f3a into agentscope-ai:main Sep 27, 2025
10 checks passed
rayrayraykk pushed a commit to rayrayraykk/AgentScope that referenced this pull request Dec 22, 2025
Kanaricc pushed a commit to Kanaricc/agentscope that referenced this pull request Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How AgentScope can be applied to a Retrieval-Augmented Generation (RAG) system Rebuild the RAG module in AgentScope

4 participants